<?php
namespace Common\Model;
use Think\Model;

class AgentModel extends Model
{
    // 查看代理品牌和品牌预存款信息
    public function get_agent_brand_and_money( $agent_id )
    {
        $brands = M("agent_brand a")
            ->join(C("DB_PREFIX")."brand b ON a.brand_id = b.id" ,"LEFT")
            ->field("a.*,b.b_name")
            ->where("a.agent_id = $agent_id")->select();
        return $brands;
    }

}